package com.hs.device.all.controller;

import com.hs.common.core.domain.Result;
import com.hs.device.all.entity.vo.DeviceListVo;
import com.hs.device.all.service.DeviceService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/device")
public class DeviceController {

//    @Resource
//    private DeviceProperties deviceProperties;

    @Resource
    private DeviceService deviceService;


    @GetMapping("/statistics")
    public Result<DeviceListVo> getStatistics() {
        DeviceListVo deviceListVo = deviceService.getStatistics();
        return Result.ok(deviceListVo);
    }

    /**
     * 获取设备树
     * @return
     */
    @GetMapping("/sns")
    public Result<List<List<String>>> getSns() {
        List<List<String>> list = deviceService.getSns();
        return Result.ok(list);
    }
}
